package com.yc.jpyy.mobile.service.imp;


import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;

import com.yc.jpyy.base.bean.RestResponse;
import com.yc.jpyy.mobile.dao.RearviewMirrorDao;
import com.yc.jpyy.mobile.service.CommonService;
import com.yc.jpyy.mobile.service.RearviewMirrorService;
@Service
public class RearviewMirrorServiceImpl extends CommonService implements RearviewMirrorService{
	
	@Autowired
	private RearviewMirrorDao rearviewMirrorDao;

	@Override
	public RestResponse getAppointCourseByTeacher(Map<String, Object> paramMap,
			RestResponse response) throws DataAccessException {
		List<Map<String, Object>> map = rearviewMirrorDao.getAppointCourseByTeacher(paramMap);
		if(null != map && map.size() > 0){		
		    response.setData(map);	
		}else{
			response.setErrorcode(1);
			response.setMessage("无预约信息");
		}
		return response;
	}

	@Override
	public RestResponse getTeachDataByTeacher(Map<String, Object> paramMap,
			RestResponse response) throws DataAccessException {
		List<Map<String, Object>> map = rearviewMirrorDao.getTeachDataByTeacher(paramMap);
		if(null != map && map.size() > 0){		
		    response.setData(map);	
		}else{
			response.setErrorcode(1);
			response.setMessage("无教学信息");
		}
		return response;
	}

	@Override
	public RestResponse getCalssInfoByStudent(Map<String, Object> paramMap,
			RestResponse response) throws DataAccessException {
		Map<String, Object> map = rearviewMirrorDao.getCalssInfoByStudent(paramMap);
		if(null != map && map.size() > 0){		
		    response.setData(map);	
		}else{
			response.setErrorcode(1);
			response.setMessage("无学时信息");
		}
		return response;
	}

}
